<?php

namespace App\Enums;

use App\Traits\Singleton;

class RedisKeyEnum
{
    const USER_IN_ROOM = 'user:in_room:%s';
    const ROOM_POPULARITY = 'room:popularity:%s';//单个房间人气%s=room_id
    const ALL_ROOM_POPULARITY = 'all:room:popularity';//所有房间人气 有序集合
    const TYPE_ROOM_POPULARITY = 'type:room:popularity:%s';//某个类型房间人气 有序集合%s=sys_type_id
    const ROOM_USERS = 'room:users:%s';//房间内的用户列表 %s=room_id
    const ROOM_INFO = 'room:info:%s';//房间信息 %s=room_id
    const ROOM_PIT_USER = 'room:pit:user:%s';//房间麦位用户 %s=room_id
    const ROOM_PIT_LOCK = 'room:pit:lock:%s';//获取房间麦位锁信息 哈希结构 %s=room_id
    const ROOM_BLACK_LIST = 'room:black_list:%s';//获取房间黑名单列表 有序集合 %s=room_id
    const ROOM_BANNED = 'room:banned:%s';//获取房间禁言列表 有序集合 %s=room_id
    const ROOM_PIT_APPLY = 'room:pit_apply:%s';//获取获取房间排麦列表 有序集合 %s=room_id
    const USER_INFO = 'user:info:%s';//获取用户信息 哈希结构 %s=user_id
    const ROOM_POPULARITY_MI_DECR = 'room:mi:decr:popularity:%s';   //幂等消费减少人气操作 无序集合
    const ROOM_FAVORITE = 'room:favorite:%s';   //房间关注 无序集合
    const NOBILITY_USERS = 'nobility:users';//有爵位的用户 hash
    const IdempotentRedisKey = "queue:idempotent:";   //幂等消费redisKey
    const EasySwooleQueueSuccessKey = "task:queue:success";
    const USER_EXP = 'u:exp:%s';//用户经验值 string %s=user_id
    const USER_CHARM = 'u:charm:%s';//用户魅力 string %s=user_id
    const INDEX_ROOM_CACHE = "index:room:cache:";
    const NEW_INDEX_ROOM_CACHE = "index:newRoom:cache:";
    const USER_ACTION = 'u:action:%s';//用户被封禁的行为 哈希 %s=user_id

    const HAS_GET_CHAT_KEY = "chat:has:get";

    const USER_VERIFY_STATUS = "user:verify:status:";


    const USER_FOOT_MARK = "user:foot:mark:";
    const USER_FOOT_MARK_KEYS = "user:foot:mark:keys";

    //个性商城相关key
    const USER_JOIN_SPECIAL = 'u:join:special:';//进场特效 string
    const USER_HP = 'u:hp:';//头像框 string
    const USER_RIDE = 'u:ride:';//坐骑 string
    const USER_CHAT_BUBBLE = 'u:chat:bubble:';//聊天声喵
    const USER_ROOM_CHAT_BUBBLE = 'u:room:chat:bubble:';//房间聊天声喵
    const USER_GLOBAL_BROADCAST = 'u:global:broadcast:';//全服广播
    const USER_SOUND_WAVE = 'u:sound:wave:';//声波
    const USER_NICKNAME_SPECIAL = 'u:nickname:special:';//昵称特效
    const USER_NICKNAME = 'u:nickname:';//昵称挂件
    const USER_CARD_FRAME = 'u:card:frame:';//名片框

    const ROOM_USER_CONTRIBUTION = 'room:user:contribution:%s:%s';

    const ROOM_VIP_USERS = 'room:vip:users:%s';
    const ROOM_CONTRIBUTION_CONFIG = 'room:contribution:config';

    // 房间互动表情
    const ROOM_USER_FACE = "act:room_user:interaction_face:set:%s";
    const ROOM_FACE = "act:room:interaction_face:set:%s";
    const ROOM_FACE_LIMIT = "act:room:interaction_face_limit:use:%s";

    //关系
    const USER_CONNECT_EXP = "user:connect:exp:";

    const RELATION_RANK = 'connect:intimacy:cp:';   //关系排行
    const RELATION_ALL = 'connect:relation';   //所有关系

    const CONNECT_OPEN_BOX_LOCK = "connect:lock:open:box:";
    const LAST_GIFT_POOL_LOCK = "connect:last:pool:lock:";
    //用户增加接收礼物到背包
    const USER_ACCEPTING_GIFT_TO_BAG = "user:accepting:gift:to:bag:";

    // 版本号
    const APP_KEY = "act:version:app_setting:%s";

    //我要上公屏活动详情
    const SCREEN_ACTIVITY_DETAIL = "screen:activity:detail:";
    const SCREEN_ACTIVITY_JOIN_LIST = "screen:activity:join:list:"; //我要上公屏参与详情
    const SCREEN_ACTIVITY_JOIN_HEAD_USER = "screen:activity:join:header:"; //我要上公屏头部用户列表
    const SCREEN_ACTIVITY_WINNER_LIST = "screen:activity:winner:"; //我要上公屏中奖用户列表
    //是否有进行中的房间我要上公屏活动
    const ROOM_ING_SCREEN_ACTIVITY = "room:screen:activity:";

    //语音轰趴活动
    public const VOTE_RANK = 'carnival:vote_rank_round:%d:%d';
    public const VOTE_RANK_Lock = 'carnival:vote_rank_lock_round:%d';
    public const USER_VOTE_Lock = 'carnival:user_vote_lock:%d';
    public const USER_Task_Lock = 'carnival:user_task_lock:%d:%d';
    public const CARNIVAL_USER_RECEIVE_LOCK = 'carnival_user_receive_lock:%s:%d';
    public const TIMEOUT_VOTE_RANK = 365 * 86400;

    // 群审核状态
    public const GROUP_NAME_AUDIT_FIELD = "name"; // 群名称
    public const GROUP_AVATAR_AUDIT_FIELD = "avatar"; // 群头像
    public const GROUP_COVER_AUDIT_FIELD = "cover"; // 群封面
    public const GROUP_INTRODUCTION_AUDIT_FIELD = "introduction"; // 群简介
    public const GROUP_BULLETIN_AUDIT_FIELD = "bulletin"; // 群公告


    const SCREEN_AD_SHOW_LISt = "screen:ad:show"; //开屏广告列表缓存

    const STREAMER_INC_SCORE = 'streamer:inc_score:%s';
    const CONNECTION_GENDER_USER = 'user:connection:status';

    //获取累充活动用户领奖锁信息 %s=user_id
    public const ACCUMULATE_RECHARGE_RECEIVE_LOCK = 'accumulate:recharge:receive:lock:%s';

    use Singleton;

    public function getGroupAuditStatusKey(int $groupId): string
    {
        return "group:audit:status:" . $groupId;
    }
}
